package com.ourteam.product.model.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Tue Nov 07 10:29:34 IRKT 2017
 * Auto Generate Date : 2017-11-15 14:51:45
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class ProductDatabaseBean implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id",
            com.ourteam.product.model.dao.IProductDatabaseDAO.Id);

        mappedDaoFields.put("databaseName",
            com.ourteam.product.model.dao.IProductDatabaseDAO.DatabaseName);

        mappedDaoFields.put("databaseType",
            com.ourteam.product.model.dao.IProductDatabaseDAO.DatabaseType);

        mappedDaoFields.put("databaseUser",
            com.ourteam.product.model.dao.IProductDatabaseDAO.DatabaseUser);

        mappedDaoFields.put("databasePassword",
            com.ourteam.product.model.dao.IProductDatabaseDAO.DatabasePassword);

        mappedDaoFields.put("databaseIp",
            com.ourteam.product.model.dao.IProductDatabaseDAO.DatabaseIp);

        mappedDaoFields.put("databasePort",
            com.ourteam.product.model.dao.IProductDatabaseDAO.DatabasePort);

        mappedDaoFields.put("databaseServiceId",
            com.ourteam.product.model.dao.IProductDatabaseDAO.DatabaseServiceId);

        mappedDaoFields.put("status",
            com.ourteam.product.model.dao.IProductDatabaseDAO.Status);

        mappedDaoFields.put("remarks",
            com.ourteam.product.model.dao.IProductDatabaseDAO.Remarks);
    }

    private com.ourteam.product.model.dao.ProductDatabase productDatabase;

    public ProductDatabaseBean() {
        super();

        this.productDatabase = new com.ourteam.product.model.dao.ProductDatabase();
    }

    public ProductDatabaseBean(
        com.ourteam.product.model.dao.ProductDatabase productDatabase) {
        super();

        this.productDatabase = productDatabase;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(productDatabase);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.product.model.dao.ProductDatabase convertToProductDatabase() {
        return this.productDatabase;
    }

    public com.ourteam.product.model.dao.ProductDatabase convertTo() {
        return this.productDatabase;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.productDatabase.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.productDatabase.setId(id);
    }

    /**
     * Get databaseName
     *
     * @return String
     */
    public String getDatabaseName() {
        return (String) this.productDatabase.getDatabaseName();
    }

    /**
     * Set databaseName
     *
     * @parameter String
     */
    public void setDatabaseName(String databaseName) {
        this.productDatabase.setDatabaseName(databaseName);
    }

    /**
     * Get databaseType
     *
     * @return String
     */
    public String getDatabaseType() {
        return (String) this.productDatabase.getDatabaseType();
    }

    /**
     * Set databaseType
     *
     * @parameter String
     */
    public void setDatabaseType(String databaseType) {
        this.productDatabase.setDatabaseType(databaseType);
    }

    /**
     * Get databaseUser
     *
     * @return String
     */
    public String getDatabaseUser() {
        return (String) this.productDatabase.getDatabaseUser();
    }

    /**
     * Set databaseUser
     *
     * @parameter String
     */
    public void setDatabaseUser(String databaseUser) {
        this.productDatabase.setDatabaseUser(databaseUser);
    }

    /**
     * Get databasePassword
     *
     * @return String
     */
    public String getDatabasePassword() {
        return (String) this.productDatabase.getDatabasePassword();
    }

    /**
     * Set databasePassword
     *
     * @parameter String
     */
    public void setDatabasePassword(String databasePassword) {
        this.productDatabase.setDatabasePassword(databasePassword);
    }

    /**
     * Get databaseIp
     *
     * @return String
     */
    public String getDatabaseIp() {
        return (String) this.productDatabase.getDatabaseIp();
    }

    /**
     * Set databaseIp
     *
     * @parameter String
     */
    public void setDatabaseIp(String databaseIp) {
        this.productDatabase.setDatabaseIp(databaseIp);
    }

    /**
     * Get databasePort
     *
     * @return String
     */
    public String getDatabasePort() {
        return (String) this.productDatabase.getDatabasePort();
    }

    /**
     * Set databasePort
     *
     * @parameter String
     */
    public void setDatabasePort(String databasePort) {
        this.productDatabase.setDatabasePort(databasePort);
    }

    /**
     * Get databaseServiceId
     *
     * @return String
     */
    public String getDatabaseServiceId() {
        return (String) this.productDatabase.getDatabaseServiceId();
    }

    /**
     * Set databaseServiceId
     *
     * @parameter String
     */
    public void setDatabaseServiceId(String databaseServiceId) {
        this.productDatabase.setDatabaseServiceId(databaseServiceId);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.productDatabase.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.productDatabase.setStatus(status);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.productDatabase.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.productDatabase.setRemarks(remarks);
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof ProductDatabaseBean) == false) {
            return false;
        } // end if

        ProductDatabaseBean other = (ProductDatabaseBean) obj;

        boolean isEqual = false;

        com.ourteam.product.model.dao.ProductDatabase tempProductDatabase = other.convertToProductDatabase();

        if ((tempProductDatabase == null) || (this.productDatabase == null)) {
            isEqual = false;
        } else if ((tempProductDatabase == this.productDatabase) ||
                tempProductDatabase.equals(this.productDatabase)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static ProductDatabaseBean[] toArray(
        com.ourteam.product.model.dao.ProductDatabase[] aProductDatabases) {
        return toArray(aProductDatabases, null);
    }

    public static ProductDatabaseBean[] toArray(
        com.ourteam.product.model.dao.ProductDatabase[] aProductDatabases,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aProductDatabases)) {
            return new ProductDatabaseBean[0];
        }

        int length = aProductDatabases.length;

        ProductDatabaseBean[] beans = new ProductDatabaseBean[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new ProductDatabaseBean(aProductDatabases[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i],
                    new Object[] { aProductDatabases[i] });
            }
        }

        return beans;
    }
}
